package com.xiaoxin.project.system.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaoxin.project.system.domain.SysOrder;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 订单Mapper接口
 *
 * @author ZhangXX
 */
public interface SysOrderMapper extends BaseMapper<SysOrder> {
    /**
     * 查询订单
     *
     * @param orderId 订单编号
     * @return 订单信息
     */
    public SysOrder selectSysOrderById(Long orderId);

    /**
     * 查询订单列表
     *
     * @param sysOrder 订单信息
     * @return 订单列表
     */
    public List<SysOrder> selectSysOrderList(SysOrder sysOrder);

    /**
     * 新增订单
     *
     * @param sysOrder 订单
     * @return 结果
     */
    public int insertSysOrder(SysOrder sysOrder);

    @Select("SELECT * FROM sys_order where user_id BETWEEN #{startUserId} AND #{endUserId}")
    List<SysOrder> selectSysOrderByUserId(Long startUserId, Long endUserId);

    /**
     * 查询订单以及订单详情
     *
     * @param orderId 订单编号
     * @return 订单信息
     */
    public SysOrder selectSysOrderDetail(@Param(value = "orderId") Long orderId);
}
